<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>家庭医生</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css" />
		<link rel="stylesheet" href="../css/mui.picker.css" />
		<link rel="stylesheet" href="../css/mui.poppicker.css" />
		<link rel="stylesheet" href="../css/feedback.css" />
		<link rel="stylesheet" href="../css/main.css" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<link rel="stylesheet" href="../css/familydoctor/familydoctor.css" />
		<style>
			.mui-table-view-chevron .mui-table-view-cell {
				/*padding-right: 40px;*/
			}
			
			.mui-table-view-chevron .mui-table-view-cell {
				padding-right: 20px;
			}
			
			.mui-segmented-control {
				font-size: 15px;
				font-weight: 400;
				position: relative;
				display: table;
				overflow: hidden;
				width: 100%;
				table-layout: fixed;
				border: 1px solid #44cfd4;
				border-radius: 3px;
				background-color: transparent;
				-webkit-touch-callout: none;
			}
			
			.style1 {
				padding: 10px 10px;
				background-color: #ffffff;
			}
			
			.mui-segmented-control .mui-control-item.mui-active {
				color: #fff;
				background-color: #44cfd4;
			}
			
			.mui-segmented-control .mui-control-item {
				line-height: 38px;
				display: table-cell;
				overflow: hidden;
				width: 1%;
				-webkit-transition: background-color .1s linear;
				transition: background-color .1s linear;
				text-align: center;
				white-space: nowrap;
				text-overflow: ellipsis;
				color: #44cfd4;
				border-color: #44cfd4;
				border-left: 1px solid #44cfd4;
			}
			
			.wrapper {
				/*    position: absolute;*/
				z-index: 2;
				top: 0;
				bottom: 0;
				left: 0;
				/* overflow: hidden; */
				width: 100%;
			}
			
			.mui-table-view-cell p {
				margin-bottom: 0;
				font-size: 12px;
			}
			
			.imgx {
				width: 43px;
			}
			
			.dh {
				margin-left: 10px;
				text-align: center;
			}
			
			.mui-segmented-control {
				font-size: 13px;
			}
			
			.mui-content1 {
				font-size: 12px;
				color: #999999;
				padding-top: 20px;
				/*text-align: center;*/
			}
		</style>
		<style>
			.mui-content {
				margin-top: 0.08rem;
				font-size: 0.2916rem;
			}
			
			#zhaoxiang {
				height: 2rem;
			}
			
			#zhaoxiang.mui-table-view-cell {
				padding-top: 0.3rem;
				height: 130px;
			}
			
			#zhaoxiang a span:after {
				top: 40%;
			}
			
			#head_image {
				width: 90px;
				height: 90px;
				border-radius: 50px;
				margin-top: 10px;
			}
			
			.head {
				margin-top: -0.6rem;
				margin-right: 15px;
			}
			
			.mui-content>.mui-table-view:first-child {
				margin-bottom: 0.08rem;
			}
			
			#libiao li {
				height: 1.0rem;
				padding-top: 0.25rem;
			}
			
			#libiao li span {
				margin-right: 20px;
				font-size: 14px;
			}
			
			.qianming {
				width: 50%;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				text-align: right;
			}
			
			.mui-table-view-cell:after {
				left: 0;
			}
			
			.mui-navigate-right:after {
				font-size: 25px;
				right: 5px;
			}
			
			.mui-table-view-cell a {
				color: #424242;
			}
			
			.mui-table-view-cell span {
				color: #999999;
			}
			
			#forward {
				font-size: 0.3124rem;
				font-weight: 400;
			}
			
			#male {
				color: #00c0ff;
				height: 1.1rem;
			}
			
			#female {
				color: #ff0072;
				height: 1.1rem;
			}
			
			#male div,
			#female div {
				background: url(../../../image/tubiao2.png) no-repeat;
			}
			
			.redword {
				color: #FF3300 !important;
			}
			
			.shengfen_upload {
				max-width: 100%;
				background: #FFFFFF;
				height: 200px;
				padding-top: 70px;
			}
			
			.mui-content-padded a {
				margin: 3px;
				width: 50px;
				height: 50px;
				display: block;
				text-align: center;
				background-color: #fff;
				border: 1px solid #ddd;
				border-radius: 25px;
				background-clip: padding-box;
				margin: 0 auto;
			}
			
			.mui-content-padded a .mui-icon {
				margin-top: 12px;
				color: #000000;
				margin-top: -7px;
				margin-left: -6px;
			}
			
			.mui-icon {
				font-size: 60px;
			}
			
			.upload_word {
				margin: 10px auto;
				display: block;
				text-align: center;
			}
			
			.shenfen_card,
			.sign_name {
				width: 70% !important;
				height: 20px !important;
				font-size: 14px;
			}
			
			.error_shenfen_card {
				border: 1px dotted rgba(0, 0, 0, 0) !important;
			}
			
			.right_shenfen_card {
				border: 1px solid rgba(0, 0, 0, 0) !important;
			}
			
			input[type="number"] {
				border: 1px solid rgba(0, 0, 0, 0) !important;
			}
			
			.mui-table-view-position .mui-table-view-cell-position {
				margin-top: 12px;
			}
			
			.mui-table-view-position .one {
				margin-top: 7px;
			}
			
			.mui-table-view-cell-position img {
				margin-right: 16px;
				margin-left: 10px;
			}
			
			.mui-table-view-position input {
				width: 0.01rem !important;
			}
			
			.mui-checkbox input[type=checkbox]:before,
			.mui-radio input[type=radio]:before {
				font-family: Muiicons;
				font-size: 14px;
				font-weight: 400;
				text-decoration: none;
				color: #aaa;
				border-radius: 0;
				background: 0 0;
				-webkit-font-smoothing: antialiased;
				margin-left: 10px!important;
			}
			
			.mui-input-row label {
				padding: 0;
				width: 85%;
			}
			
			.mui-content .mui-table-view .mui-table-view-cell .labelL .picture {
				float: left;
				width: 0.7rem !important;
				margin-left: 0%;
			}
			
			.mui-content .mui-table-view .mui-table-view-cell .labelL .artle {
				float: left;
				margin-left: 10px;
				margin-top: 6px;
				padding-left: 0;
				width: 80%;
			}
			
			.view-cell img {
				margin-right: 12px !important;
				margin-left: 16px !important;
				text-align: center;
				width: 0.4rem !important;
			}
			
			.mui-table-view-cell-position img {
				margin-right: 10px!important;
				margin-left: 16px!important;
			}
			
			img,
			button {
				max-width: 80%;
			}
			
			.qylc {
				text-align: center;
				margin-top: 2rem;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">家庭医生</h1>
		</header>
		<div class="mui-content">
			<div class="style1">
				<div id="segmentedControl" class="mui-segmented-control">
					<a class="mui-control-item mui-active" href="#item1">医生之家</a>
					<a class="mui-control-item" href="#item2" id="my_doctor">我的医生</a>
					<a class="mui-control-item" href="#item3" id="my_healness">健康数据</a>
				</div>
			</div>
			<div class="phone-call">
				<div id="item1" class="mui-control-content mui-active">
					<div id="scroll" class="wrapper">
						<div class="mui-content">
							<ul class="mui-table-view firstUl" id="table-viewX">
								<li class="mui-table-view-cell mui-media">
									<a class="mui-navigate-right" id="fdtintroduce">
										<div class="mui-media-body">家庭医生介绍</div>
									</a>
								</li>
							</ul>
							<ul class="mui-table-view" id="table-viewX">
								<li class="mui-table-view-cell">
									<a id="servicenote" class="mui-navigate-right">
										<div class="mui-media-body">
											服务协议
										</div>
									</a>
								</li>
							</ul>
							<ul class="mui-table-view" id="table-viewX">
								<li class="mui-table-view-cell">
									<a id="zccontent" class="mui-navigate-right">
										<div class="mui-media-body">
											政策内容
										</div>
									</a>
								</li>
							</ul>
							<ul class="mui-table-view" id="table-viewX">
								<li class="mui-table-view-cell">
									<a id="goodjob" class="mui-navigate-right">
										<div class="mui-media-body">
											优秀案例
										</div>
									</a>
								</li>
							</ul>
						</div>
					</div>
					<div class="mui-content-padded qylc">
						<img id="qylc" class="img" style="" src="../images/familydoctor/jtyyjs.png" />
					</div>
				</div>
				<!--签约流程-->

				<div id="item2" class="mui-control-content">
					<!--已签约-->
					<div id="YQ" class="mui-content">
						<ul class="mui-table-view mui-table-view-chevron gerenzhongxin" id="gerenzhongxin">
							<li class="mui-table-view-cell mui-media">
								<div class="mui-row">
									<div id="team" class="mui-col-xs-10 mui-row">
										<div class="mui-col-xs-5" id="u1105">
											<img id="u1105_img" class="img" src="" style="width: 70px;height: 70px;border-radius: 50%;" />
										</div>
										<div class="mui-col-xs-7" id="u1107" style="margin-left: -20px;">
											<p id="doctorTeam" style="font-size: 16px;padding-top: 8%;"></p>
											<p id="area" style="font-size:14px;"></p>
										</div>
									</div>

									<div class="mui-col-xs-2 dh1" style="margin-top: 10px;">
										<div id="u1109" class="">
											<img id="call" class="imgx" src="../images/familydoctor/u97.png" />
											<p>一键拨号</p>
										</div>
									</div>
								</div>
							</li>
						</ul>
						<ul class="mui-table-view" id="table-viewX">
							<li class="mui-table-view-cell">
								<a id="service_package" class="mui-navigate-right">
									<div class="mui-media-body">
										签约服务包
									</div>
								</a>
							</li>
						</ul>
						<ul class="mui-table-view" id="table-viewX">
							<li class="mui-table-view-cell">
								<a class="mui-navigate-right" id="jiuzhen_notice">
									<div class="mui-media-body">
										就诊提醒
									</div>
								</a>

							</li>
						</ul>
					</div>

					<!--已分配-->
					<div id="YFP" class="mui-content">
						<ul class="mui-table-view mui-table-view-chevron gerenzhongxin" id="gerenzhongxin">
							<li class="mui-table-view-cell mui-media">
								<div class="mui-row">
									<div id="teamYFP" class="mui-col-xs-10 mui-row">
										<div class="mui-col-xs-5" id="u1105">
											<img id="u1106_img" class="img" src="" style="width: 70px;height: 70px;border-radius: 50%;" />
										</div>
										<div class="mui-col-xs-7" id="u1107" style="margin-left: -20px;">
											<p id="doctorTeamYFP" style="font-size: 16px;padding-top: 8%;"></p>
											<p id="areaYFP" style="font-size:14px;"></p>
										</div>
									</div>
									<div class="mui-col-xs-2 dh2" style="margin-top: 10px;">
										<div id="u1109" class="">
											<img id="call" class="imgx" src="../images/familydoctor/u97.png" />
											<p>一键拨号</p>
										</div>
									</div>
								</div>
							</li>
						</ul>
					</div>
					<!--未分配-->
					<div id="WFP" class="mui-content1" id="mydoctor">
						<div class="mui-content" id="content">
							<ul class="mui-table-view" id="homeAddUl">

								<li class="mui-table-view-cell ">
									<label class="labelL">
										<div class="picture left"><img src="../images/familydoctor/jiahui.png" /></div>
										<div class="artle left" id="homeAdd">设置家的位置</div>
									</label>
								</li>

							</ul>
							<ul class="mui-table-view-position" id="addTip" style="">
								<li class="mui-table-view-cell-position">
									<div style="text-align: center;color: orange;font-size: 18px;">温馨提示</div>
								</li>
								<li class="mui-table-view-cell-position">
									<p id="tip_info">
										1、目前您尚未加入任何家庭医生团队。<br> 2、在本页面设置完您的家庭地址后请耐心等待。
										<br> 3、系统会按您指定的地址就近为您分配家庭医生团队。
										<br>
									</p>
								</li>
							</ul>

						</div>
					</div>
				</div>
				<div id="item3" class="mui-control-content">
				</div>
			</div>
		</div>
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/constants.js"></script>
		<script type="text/javascript" src="../js/common.js"></script>
		<script src="../js/mui.previewimage.js"></script>
		<script src="../js/mui.zoom.js"></script>
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/xiangyingshi.js"></script>
		<script type="text/javascript" src="../js/jquery-3.1.1.js"></script>
		<script type="text/javascript" src="../plugs/moment/moment.min.js"></script>
		<script type="text/javascript" src="../js/art/template-web.js"></script>
		<script type="text/javascript" src="../js/qs/qs.art.extend.js"></script>
		<script type="text/javascript" src="../js/qs/qs.template.js"></script>
		<script type="text/javascript" src="../js/iscroll/iscroll-probe.js"></script>
		<script type="text/javascript" src="../js/qs/qs.iscroll.js"></script>
		<script>
			mui.init({
				swipeBack: true //启用右滑关闭功能
			});

			mui.plusReady(function() {
				if(plus.navigator.isImmersedStatusbar()) { // 兼容immersed状态栏模式
					// 获取状态栏高度并根据业务需求处理，这里重新计算了子窗口的偏移位置
					topoffset = (Math.round(plus.navigator.getStatusbarHeight()) + 45) + 'px';
					document.querySelector("header").style.height = topoffset;
					document.querySelector("header").style.paddingTop = "20px";
					document.querySelector(".mui-bar-nav~.mui-content").style.paddingTop = topoffset;
				}
				// 加载完毕后关闭等待框，并展示页面
				var currentView = plus.webview.currentWebview();
				currentView.show('slide-in-right', 200);
				plus.nativeUI.closeWaiting();
				var teamInfo;
				var signDate;
				$("#YFP").hide();
				$("#YQ").hide();
				$("#WFP").hide();
				var currentView = plus.webview.currentWebview();
				currentView.show('slide-in-right', 200);
				plus.nativeUI.closeWaiting();
				patient = JSON.parse(localStorage.getItem("currentPatient"));
				console.log(JSON.stringify(patient));
				if(patient) {
					$("#homeAdd").text(patient.fdthomeaddress ? patient.fdthomeaddress : "长春");

				}

				if(patient && patient.fdthomeaddress) {
					var txt = "您已选择过家庭地址,请耐心等待系统分配家庭医生团队即可。<br>如果想要重新设置家庭住址可忽略本提示继续操作。";
					$("#tip_info").html(txt);
				} else {
					var txt = "1、目前您尚未加入任何家庭医生团队。<br>2、在本页面设置完您的家庭地址后请耐心等待。<br> 	3、系统会按您指定的地址就近为您分配家庭医生团队。<br>";
					$("#tip_info").html(txt);
				}

				$("#homeAddUl").on("tap", function() {
					//console.log(JSON.stringify($(this)))
					//console.log(JSON.stringify($(this).text()))
					var lastSelectedAddress = $(this).text().trim();
					//console.log(lastSelectedAddress.trim());
					var webview = mui.openWindow({
						url: 'set_address.html',
						id: 'set_address',
						show: {
							autoShow: false, //页面loaded事件发生后自动显示，默认为true
							event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
						},
						waiting: {
							autoShow: true //自动显示等待框，默认为true
						},
						extras: {
							title: '选择家庭住址',
							cb: 'setHomeAddress',
							startAt: lastSelectedAddress
						}
					});
				});
				//点击团队，进入团队详情页面
				$("#team").click(function(event) {
					console.log("点击团队，进入团队详情页面teamInfo" + JSON.stringify(teamInfo));
					var self = plus.webview.currentWebview();
					mui.openWindow({
						url: 'fdt_detail.html',
						id: 'fdt_detail',
						extras: {
							teamInfo: teamInfo,
							signDate: signDate
						},
						show: {
							autoShow: false, //页面loaded事件发生后自动显示，默认为true
							event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
						},
						waiting: {
							autoShow: true //自动显示等待框，默认为true
						}
					});
					mui('.mui-popover').popover('hide');
				});

				//点击签约流程，进入签约流程页面
				$("#qylc").click(function(event) {
					var self = plus.webview.currentWebview();
					mui.openWindow({
						url: 'qylc.html',
						id: 'qylc',
						extras: {
							teamInfo: teamInfo,
							signDate: signDate
						},
						show: {
							autoShow: false, //页面loaded事件发生后自动显示，默认为true
							event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
						},
						waiting: {
							autoShow: true //自动显示等待框，默认为true
						}
					});
					mui('.mui-popover').popover('hide');
				});

				$("#teamYFP").click(function(event) {
					console.log("点击团队，进入团队详情页面teamYFPteamInfo" + JSON.stringify(teamInfo));
					var self = plus.webview.currentWebview();
					mui.openWindow({
						url: 'fdt_detail.html',
						id: 'fdt_detail',
						extras: {
							teamInfo: teamInfo
						},
						show: {
							autoShow: false, //页面loaded事件发生后自动显示，默认为true
							event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
						},
						waiting: {
							autoShow: true //自动显示等待框，默认为true
						}
					});
					mui('.mui-popover').popover('hide');
				});
				var status;
				var success = function(data) {
					//服务器返回响应，根据响应结果，分析是否登录成功；
					if(data) {
						if(data.result = "success") {
							signDate = data.signDate;
							status = data.node;
							if(data.node == "WFP") { //1.未分配
								$("#WFP").show();
							} else {
								var fdtid = data.fdt._id;
								localStorage.setItem("currentFDT", fdtid);
								$("#jiuzhen_notice").click(function(e) {
									mui.openWindow({
										url: 'jiuzhen_notice.html',
										id: 'jiuzhen_notice.html',
										show: {
											autoShow: false, //页面loaded事件发生后自动显示，默认为true
											event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
										},
										waiting: {
											autoShow: true //自动显示等待框，默认为true
										},
										extras: {
											fdtid: fdtid
										}
									});
								})

								$("#service_package").click(function(e) {
									mui.openWindow({
										url: 'service_package.html',
										id: 'service_package.html',
										show: {
											autoShow: false, //页面loaded事件发生后自动显示，默认为true
											event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
										},
										waiting: {
											autoShow: true //自动显示等待框，默认为true
										}
									});
								})

								var fdturl = serverAddress + "/api/appfamilydoctorteamforpatient/redaone/" + fdtid;

								var fdtsuccess = function(fdtdata) {
									teamInfo = fdtdata.obj;
									//打电话
									mui(".phone-call").on("click", ".dh1", function() {
										var btnArray = ['拨打', '取消'];
										var Phone = teamInfo.phone;
										mui.confirm('是否拨打 ' + Phone + ' ？', '提示', btnArray, function(e) {
											if(e.index == 0) {
												plus.device.dial(Phone, false);
											}
										})
									});
									mui(".phone-call").on("click", ".dh2", function() {
										var btnArray = ['拨打', '取消'];
										var Phone = teamInfo.phone;
										mui.confirm('是否拨打 ' + Phone + ' ？', '提示', btnArray, function(e) {
											if(e.index == 0) {
												plus.device.dial(Phone, false);
											}
										})
									});
									if(data.node == "YQ") { //2.已签约
										$("#YQ").show();
										$("#doctorTeam").html(teamInfo.name);
										$("#area").html(teamInfo.area);

										$("#u1105_img").attr("src", serverAddress + teamInfo.logo.replace('client', '').replace(/\\/g, "/"));
										//进入就诊提醒页面
										console.log(serverAddress + teamInfo.logo.replace('client', '').replace(/\\/g, "/"));
									} else if(data.node == "YFP") { //3.已分配
										$("#u1106_img").attr("src", serverAddress + teamInfo.logo.replace('client', '').replace(/\\/g, "/"));
										$("#doctorTeamYFP").html(teamInfo.name);
										$("#areaYFP").html(teamInfo.area);
										$("#YFP").show();
									}
								}
								commonHttpUtils(fdturl, "get", {}, fdtsuccess, error, true);
							}
						}
					}

				};
				var id = localStorage.getItem("TOKENID");
				var url = serverAddress + "/api/patient/edit/" + id;
				commonHttpUtils(url, "get", {}, success, error, true);

				//医生之家  点击跳转
				//家庭医生介绍
				$("#fdtintroduce").click(function(e) {
					var type = "fdtintroduce";
					getOneBaseInfo(type);
				});

				//服务协议 
				$("#servicenote").click(function(e) {
					var type = "agreement";
					getOneBaseInfo(type);
				});
				//政策内容
				$("#zccontent").click(function(e) {
					var type = "zccontent";
					var title = "政策内容";
					getBaseInfos(type, title);
				});
				//优秀案例
				$("#goodjob").click(function(e) {
					var type = "goodjob";
					var title = "优秀案例";
					getBaseInfos(type, title);
				});

				function getOneBaseInfo(type) {
					var filter = {};
					filter.type = type;
					var article = {};
					var fdtiurl = serverAddress + "/api/baseinfo/applistbycode";
					var artsuccess = function(articles) {
						if(articles.result == "success") {
							article = articles.data[0];
							if(!article) {
								console.log();
							}
							console.log("article==article==>" + JSON.stringify(article));
							mui.openWindow({
								url: 'article.html',
								id: 'article.html',
								show: {
									autoShow: false, //页面loaded事件发生后自动显示，默认为true
									event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
								},
								waiting: {
									autoShow: true //自动显示等待框，默认为true
								},
								extras: {
									article: JSON.stringify(article)
								}
							});
						}

					}
					commonHttpUtils(fdtiurl, "post", filter, artsuccess, error, true);
				}

				function getBaseInfos(type, title) {
					var filter = {};
					filter.type = type;
					var article = {};
					var fdtiurl = serverAddress + "/api/baseinfo/applisttitlebycode";
					var artsuccess = function(articles) {
						if(articles.result == "success") {
							articles = articles.data;
							if(!article) {
								console.log();
							}
							console.log("article==article==>" + JSON.stringify(articles));
							mui.openWindow({
								url: 'articlelist.html',
								id: 'articlelist.html',
								show: {
									autoShow: false, //页面loaded事件发生后自动显示，默认为true
									event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
								},
								waiting: {
									autoShow: true //自动显示等待框，默认为true
								},
								extras: {
									article: JSON.stringify(articles),
									title: title
								}
							});
						}
					}
					commonHttpUtils(fdtiurl, "post", filter, artsuccess, error, true);
				}

				//我的健康页面
				mui('#segmentedControl').on("tap", "#my_healness", function(e) {
					mui.openWindow({
						id: 'echarts.html',
						url: 'echarts.html',
						show: {
							autoShow: false, //页面loaded事件发生后自动显示，默认为true
							event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
						},
						waiting: {
							autoShow: true //自动显示等待框，默认为true
						}
					});
				})
				//				//未分配的情况跳转到定位界面
				//				mui('#segmentedControl').on("tap", "#my_doctor", function(e) {
				//					if(status=="WFP") {
				//						mui.openWindow({
				//							id: 'home_position.html',
				//							url: 'home_position.html',
				//							show: {
				//								autoShow: false, //页面loaded事件发生后自动显示，默认为true
				//								event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
				//							},
				//							waiting: {
				//								autoShow: true //自动显示等待框，默认为true
				//							}
				//						});
				//					}
				//
				//				})
			});

			var patient;

			function setHomeAddress() {
				var address = localStorage.selectedAddress;
				console.log(address);
				if(address == '') return;
				//console.log(localStorage.selectedAddressGPS)
				var gps = JSON.parse(localStorage.selectedAddressGPS);
				console.log(JSON.stringify(gps));
				//更新界面显示文字。
				$("#homeAdd").text(address);
				//调用后端代码，存储选中的地址。
				var id = patient._id;
				console.log(id)
				var url = serverAddress + "/api/patient/fdthomeaddressandgps/" + id;
				var data = {
					fdthomegps: gps,
					fdthomeaddress: address
				};
				commonHttpUtils(url, 'PUT', data, function(resData) {
					if(resData.result == "success") {
						patient = JSON.parse(localStorage.getItem("currentPatient"));
						patient['fdthomeaddress'] = address;
						patient['fdthomegps'] = gps;
						//update user in localStorage.
						localStorage.setItem('currentPatient', JSON.stringify(patient));
					}
				}, function() {
					mui.toast('存储服务地址时遇到网络超时，请稍后再试！');
				}, true);
			};
		</script>

	</body>

</html>